<!DOCTYPE HTML>
<html lang="zh-CN" class="ax-vertical-centered" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>图书馆管理系统</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" th:href="@{/css/bootstrap.min.css}">
    <link rel="stylesheet" th:href="@{/css/bootstrap-theme.min.css}">
    <link rel="stylesheet" th:href="@{/css/bootstrap-admin-theme.css}">
    <link rel="stylesheet" th:href="@{/css/bootstrap-admin-theme.css}">
    <script th:src="@{/jQuery/jquery-3.1.1.min.js}"></script>
    <script th:src="@{/js/bootstrap.min.js}"></script>
    <script th:src="@{/js/bootstrap-dropdown.min.js}"></script>
    <script th:src="@{/js/addAdmin.js}"></script>

</head>


<script src="../js/jquery.min.js"></script>
<script src="../static/js/bootstrap.min.js"></script>


<body class="bootstrap-admin-with-small-navbar">
<nav class="navbar navbar-inverse navbar-fixed-top bootstrap-admin-navbar bootstrap-admin-navbar-under-small"
     role="navigation">
    <div class="container">
        <div class="row">
            <div class="col-lg-12">
                <div class="collapse navbar-collapse main-navbar-collapse">
                    <a class="navbar-brand" href="/manage/home"><strong>欢迎使用图书馆管理系统</strong></a>
                    <ul class="nav navbar-nav navbar-right">
                        <li class="dropdown">
                            <a href="#" role="button" class="dropdown-toggle" data-hover="dropdown">
                                <i class="glyphicon glyphicon-user"></i> 欢迎您，<span
                                    th:text="${session.student.name}"></span>
                                <i class="caret"></i></a>

                            <ul class="dropdown-menu">
                                <li><a href="#updateinfo" data-toggle="modal">个人资料</a></li>
                                <li role="presentation" class="divider"></li>
                                <li><a href="#updatepwd" data-toggle="modal">修改密码</a></li>
                                <li role="presentation" class="divider"></li>
                                <li><a href="/admin/quit">退出</a></li>
                            </ul>

                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</nav>
<input type="hidden" th:value="${msg}" id="msg"/>
<div class="container">
    <div class="row">
        <div class="col-md-2 bootstrap-admin-col-left">
            <ul class="nav navbar-collapse collapse bootstrap-admin-navbar-side">
                <li>
                    <a href="/manage/bookManage"><i
                            class="glyphicon glyphicon-chevron-right"></i> 图书管理</a>
                </li>
                <li>
                    <a href="/manage/bookTypeManage"><i
                            class="glyphicon glyphicon-chevron-right"></i> 图书分类管理</a>
                </li>


                <li>
                    <a href="/manage/borrowSearch"><i
                            class="glyphicon glyphicon-chevron-right"></i> 借阅查询</a>
                </li>


                <li>
                    <a href="/manage/adminManage"><i
                            class="glyphicon glyphicon-chevron-right"></i> 管理员管理</a>
                </li>

                <li>
                    <a href="/manage/readerManage"><i
                            class="glyphicon glyphicon-chevron-right"></i> 读者管理</a>
                </li>
            </ul>
        </div>

        <div class="col-md-10">
            <div class="row">
                <div class="col-lg-12">
                    <div class="panel panel-default bootstrap-admin-no-table-panel">
                        <div class="panel-heading">
                            <div class="text-muted bootstrap-admin-box-title">查询</div>
                        </div>
                        <div class="bootstrap-admin-no-table-panel-content bootstrap-admin-panel-content collapse in">
                            <form class="form-horizontal" action="/fix/fix_select"
                                  method="post">
                                <div class="col-lg-6 form-group">
                                    <button type="submit" class="btn btn-primary" id="btn_query">查询当前教室报修记录
                                    </button>
                                    <button type="button" class="btn btn-primary" id="btn_add" data-toggle="modal"
                                            data-target="#addModal">新的报修
                                    </button>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-lg-12">
                    <table id="data_list" class="table table-hover table-bordered" cellspacing="0" width="100%">
                        <thead>
                        <tr>
                            <th>所在教室</th>
                            <th>报修内容</th>
                            <th>报修状态</th>
                            <th>报修人数</th>
                            <th>操作</th>
                        </tr>
                        </thead>

                        <tbody th:if="${fixes != null}" th:each="fix:${fixes}">
                        <td th:text="${fix.rid}">

                        </td>
                        <td th:text="${fix.content}">

                        </td>
                        <td th:if="${fix.sign eq '0'}" >
                            报修未获审
                        </td>
                        <td th:if="${fix.sign eq '1'}" >
                            正在维修
                        </td>
                        <td th:if="${fix.sign eq '3'}" >
                            报修已完成
                        </td>
                        <td th:text="${fix.count}">

                        </td>
                        <td>
                            <a th:href="@{/fix/fix_count(id=${fix.id})}">
                            <button type="button" class="btn btn-warning btn-xs" data-toggle="modal"
                                    data-target="#updateModal" th:onclick="">确认报修信息
                            </button>
                            </a>
<!--                            <a>-->
<!--                                <button type="button" class="btn btn-danger btn-xs">删除-->
<!--                                </button>-->
<!--                            </a>-->
                        </td>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>


<!--------------------------------------添加的模糊框------------------------>
<form class="form-horizontal" action="/fix/fix_insert">
    <div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        &times;
                    </button>
                    <h4 class="modal-title" id="myModalLabel">
                        公物损坏报修
                    </h4>
                </div>
                <div class="modal-body">
                    <div class="form-group" style="display: none">
                        <label class="col-sm-3 control-label">当前教室</label>
                        <div class="col-sm-7">
                            <input th:value="${session.student.id}" type="text" class="form-control" id="addPhone" name="sid" placeholder="">
                            <label class="control-label" for="addPhone" style="display: none;"></label>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">报修内容</label>
                        <div class="col-sm-7">
                            <input type="text" class="form-control" id="addUsername" name="content"
                                   placeholder="请简述报修内容">
                            <label class="control-label" for="addUsername" style="display:none;"></label>
                        </div>
                    </div>


                    <div class="form-group">
                        <label class="col-sm-3 control-label">添加图片</label>
                        <div class="col-sm-7">
                            <input type="file"  id="addName" name="photo" placeholder="">

                        </div>
                    </div>



                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                    </button>
                    <button type="submit" class="btn btn-primary" id="addAdmin">
                        确认报修
                    </button>
                </div>
            </div>
        </div>
    </div>

</form>

<!-- 修改模态框（Modal） -->
<form class="form-horizontal" action="/admin/admin_update">
    <div class="modal fade" id="updateModal" tabindex="-1" role="dialog" aria-labelledby="updateModalLabel"
         aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        &times;
                    </button>
                    <h4 class="modal-title" id="updateModalLabel">
                        修改管理员信息
                    </h4>
                </div>
                <div class="modal-body">
                    <input type="hidden" name="aid" id="addaId" value="">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">用户名</label>
                        <div class="col-sm-7">
                            <input type="hidden" id="updateId">
                            <input type="text" class="form-control" name="username" id="updateUsername">
                            <label class="control-label" for="updateUsername" style="display:none;"></label>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-3 control-label">真实姓名</label>
                        <div class="col-sm-7">
                            <input type="text" class="form-control" name="name" id="updateName"
                                   placeholder="请输入管理员真实姓名">
                            <label class="control-label" for="updateName" style="display:none;"></label>
                        </div>
                    </div>


                    <div class="form-group">
                        <label class="col-sm-3 control-label">联系电话</label>
                        <div class="col-sm-7">
                            <input type="text" class="form-control" name="phone" id="updatePhone"
                                   placeholder="请输入管理员联系电话">
                            <label class="control-label" for="updatePhone" style="display:none;"></label>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                    </button>
                    <button type="submit" class="btn btn-primary" id="updateAdmin">
                        修改
                    </button>
                </div>
            </div>
        </div>
    </div>

</form>
<!-------------------------------------------------------------->


<!------------------------------修改密码模糊框-------------------------------->

<form class="form-horizontal">
    <div class="modal fade" id="updatepwd" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
         aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        &times;
                    </button>
                    <h4 class="modal-title" id="myModalLabel">
                        修改密码
                    </h4>
                </div>

                <div class="modal-body">

                    <div class="form-group">
                        <label class="col-sm-3 control-label">原密码</label>
                        <div class="col-sm-7">
                            <input type="password" class="form-control" id="oldPwd" placeholder="请输入原密码">
                            <label class="control-label" for="oldPwd" style="display:none;"></label>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-3 control-label">新密码</label>
                        <div class="col-sm-7">
                            <input type="password" class="form-control" id="newPwd" placeholder="请输入新密码">
                            <label class="control-label" for="newPwd" style="display:none;"></label>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-3 control-label">确认密码</label>
                        <div class="col-sm-7">
                            <input type="password" class="form-control" id="confirmPwd" placeholder="请输入确认密码">
                            <label class="control-label" for="confirmPwd" style="display:none;"></label>
                        </div>
                    </div>


                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                    </button>
                    <button type="button" class="btn btn-primary" id="update_adminPwd">
                        修改
                    </button>
                </div>
            </div>
        </div>
    </div>

</form>
<!-------------------------------------------------------------->


<!-------------------------个人资料模糊框------------------------------------->

<form class="form-horizontal">
    <div class="modal fade" id="updateinfo" tabindex="-1" role="dialog" aria-labelledby="ModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        &times;
                    </button>
                    <h4 class="modal-title" id="ModalLabel">
                        个人资料
                    </h4>
                </div>

                <div class="modal-body">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">用户名</label>
                        <div class="col-sm-7">
                            <input type="text" class="form-control" id="username"
                                   th:value='${session.student.name}'>
                            <label class="control-label" for="username" style="display: none;"></label>
                        </div>
                    </div>


                    <div class="form-group">
                        <label class="col-sm-3 control-label">真实姓名</label>
                        <div class="col-sm-7">
                            <input type="text" class="form-control" id="name" placeholder="请输入您的真实姓名"
                                   th:value="${session.student.name}">
                            <label class="control-label" for="name" style="display: none;"></label>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-3 control-label">联系号码</label>
                        <div class="col-sm-7">
                            <input type="text" class="form-control" id="phone" placeholder="请输入您的联系号码"
                                   th:value="${session.student.phone}">
                            <label class="control-label" for="phone" style="display: none;"></label>

                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                    </button>
                    <button type="button" class="btn btn-primary" id="admin_updateInfo">
                        修改
                    </button>
                </div>
            </div>
        </div>
    </div>

</form>
<!-------------------------------------------------------------->


<div class="modal fade" id="modal_info" tabindex="-1" role="dialog" aria-labelledby="addModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" id="infoModalLabel">提示</h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-lg-12" id="div_info"></div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" id="btn_info_close" data-dismiss="modal">关闭</button>
            </div>
        </div>
    </div>
</div>
</body>
</html>
